home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDITOR
/
AMAC44.ARJ
/
SZR.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-06-22
|
4KB
|
109 lines
: SZR.BAT Search/Replace ZIP Files 6/1/92
:
:1) SYNTAX: SZR.BAT %1 %2 %3
: ┌──────────┘ │ └───────────┐
: (Mode) %1 %2 %3
: Search Text Replace Text ZIP Name
: ---------------- ------------- ------------ --------
: a) Query [ ] [ ] [ ]
: b) Partial Query Search Text [ ] [ ]
: c) Partial Query Search Text Replace Text [ ]
: d) All command line Search Text Replace Text ZIP Name
:
: where: %1 - Search Text
: %2 - Replace Text
: %3 - ZIP Name, no extension
: [ ] - entered at query prompt
:2) Requires FGREP.COM INPUT.COM DX.EXE PKZIP.EXE PKUNZIP.EXE
: SR.MAC
:
:*******************************************************************************
:* Environment Variable Action *
:* --------------------------- ----------------------------------------------- *
:* set srmac= macro files are located in current directory *
:* set srmac=c:\mac\ macro files are located in c:\mac\ directory *
:* set sztemp= uses default c:\$zip$ for temporary directory *
:* set sztemp=e:\name uses e:\name for temporary directory *
:*******************************************************************************
:
@echo OFF
cls
echo SZR.BAT, June 1, 1992
set S~~=%1
set R~~=%2
set file=%3
break on
if "%sztemp%" == "" set sztemp= c:\$zip$
if "%1" == "" echo Search Text: [Enter terminates batch file]
if not "%1" == "" if not "%2" == "" goto 2b
if not "%1" == "" goto 1a
INPUT.COM Search Text=/b
if errorlevel=1 goto 6a
set S~~=%ans%
goto 2a
:1a
echo Search Text=%S~~%
:2a
set ans=
if "%2" == "" echo Replace Text: [Enter removes search text]
INPUT.COM Replace Text=/b
: if errorlevel=1 goto 6a, removed from SZR.BAT, June 1, 1992 *|
set R~~=%ans%
:2b
set ans=
if not "%3" == "" goto 2c
echo ZIP Name(s): [ZIP Name(s), no ZIP extn] [Enter terminates batch file]
INPUT.COM ZIP Name=/b
if errorlevel=1 goto 6a
set file=%ans%
:2c
if "%file%" == "" goto 6a
if not exist %file%.ZIP goto 6a
:4a
CLS
echo SZR.BAT, June 1, 1992
echo Search Text = %S~~%
echo Replace Text = %R~~%
echo ZIP Name = %file%.ZIP
if not exist %sztemp%\nul md %sztemp%
PKUNZIP.EXE -o %file% %sztemp%
echo.
DX.EXE %sztemp% //v-/fattr:!a-/he:1/st:1/out:nul
DX.EXE %sztemp%\*.exe *.com *.zip *.mac *.arc//v-/del/he:1/st:1/out:nul
echo.
FGREP.COM -fl %S~~% %sztemp%\*.* >c:\$.ql
set >c:\$
copy c:\$.ql c:\!
Q.EXE C:\! /E%srmac%SR.MAC /L%srmac%SR.MAC
echo.
echo.
DX.EXE %sztemp%\*.* //at:!a/he:1/st:1/sing
echo.
echo Answer: [G]o non-stop Adds above files to %3.ZIP, or [Y]es, [N]o, ^C
DX.EXE %sztemp%\;.bak //ex-/at:!a/run:'pkzip -f %file% %sztemp%\$n'/he:1/st:1
echo Deleting temporary files and removing temporary directory %sztemp% . . .
echo y | erase %sztemp%\*.* >nul
rd %sztemp%
if exist %sztemp%\nul echo Directory %sztemp% still exists . . .
erase c:\!
erase c:\$.*
goto 7a
:6a
echo.
if "%S~~%" == "" echo Must specify Search Text . . . .
if "%R~~%" == "" echo Must specify Replace Text . . . .
if not exist %file%.zip echo Can't Find ZIP_File %file%.zip . . . .
if "%file%" == "" echo Must Specify ZIP_File . . . .
echo Search/Replace──INCOMPLETE──
goto 8a
:7a
echo.
echo Search/Replace──Complete──
PKUNZIP.EXE -vd %file%
:8a
echo.
break off
echo.